﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DataAccess;
using DataAccess.Helpers;
using BastInfos.Controllers;

namespace BastInfos.Models.Event
{
	public class EventModel
	{
		public int id_Event { get; set; }

		public bool ShowAlert { get; set; }

		public string Title { get; set; }

		public string Content { get; set; }

		public string Summary { get; set; }

		public DateTime EventDate { get; set; }

		public Comment Comment { get; set; }

		public IEnumerable<Comment> Comments { get; set; }

		public EventModel()
		{
			Comment = new Comment();
		}

		public EventModel(DataAccess.Event evt)
		{
			Title		= evt.Title;
			Content		= evt.Content;
			Summary		= evt.Summary;
			Comments	= evt.ValidComments;
			EventDate	= evt.EventDate;
			id_Event	= evt.id_Event;
			ShowAlert	= evt != null && evt.Status != (byte)StatusType.Visible /*&& UserMembership.IsAuthenticated*/;
			Comment		= new Comment();
		}
	}
}